package com.wise.service.cms.content.pagedecorate;

import com.wise.entities.content.Decorate;
import com.wise.framework.daomodel.DaoOne4Update;
import com.wise.framework.daomodel.DaoRemove;
import com.wise.summer.v1.cms.content.pagedecorate.DeletePageDecorate;
import org.springframework.stereotype.Service;
import org.summerframework.model.SummerService;
import org.summerframework.model.SummerServiceBean;

import static com.wise.model.content.ContentErrMsgs.Err_000500000008;


@Service
@SummerService
public class DeletePageDecorateService implements SummerServiceBean<DeletePageDecorate> {

    @Override
    public void sum(DeletePageDecorate model) {

        Decorate decorate = DaoOne4Update.s(Decorate.class, model.getId(), Err_000500000008);

        DaoRemove.s(decorate);

        model.setSummerResult(true);
    }
}
